package com.xiaoshu.common;


import com.alibaba.fastjson.JSON;

/**
 * 功能说明：
 * com.xiaoshu.common
 *
 * <p>
 * Original @Author: deane.jia-贾亮亮,2021/6/15 9:09
 * <p>
 * Copyright (C)2012-2021 小树盛凯科技 All rights reserved.
 */

public class Result<T> {

    private int code;

    private String message;

    private T data;

    public int getCode() {
        return code;
    }

    public Result setCode(ResultCode resultCode) {
        this.code = resultCode.code();
        return this;
    }

    public String getMessage() {
        return message;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result setData(T data) {
        this.data = data;
        return this;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}
